<!-- 家庭协议模板——协议内容  -->
<!-- 家庭协议模板——协议内容  -->
<!-- 家庭协议模板——协议内容  -->
<div th:fragment="template-01-01">
<div class="xymbContent">
    <div class="easyui-panel" style="padding-top:10px;padding-bottom:10px;" id="xyhDiv">
        <table style="table-layout:fixed;font-weight:bold;border:0;width:100%" cellspacing="-1" cellpadding="5">
            <tr style="height:20px;">
                <td style="width:65%;text-align: right">协议号：</td>
                <td class="jqxy_form_control" name="XYH" id="XYH" style="width:21%;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#B6B6B6">
                    <svg id="txmBox" style="width: 100%;height: 20px;"></svg>
                </td>
                <td></td>
            </tr>
            <tr style="height:8px">
                <td></td>
            </tr>
            <tr style="height:20px;">
                <td style="text-align: right">健康档案号：</td>
                <td class="jqxy_form_control" name="JKDAH" style="border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#B6B6B6"></td>
                <td></td>
            </tr>
        </table>
    </div>
    <div class="easyui-panel" border="false" style="padding-top:10px;font-size:18px;font-weight:bold;text-align: center;padding-bottom:20px">
        <p>广州市基层医疗卫生机构家庭医生签约服务协议书</p><!--必须要用p标签包住，不然在下载为pdf文件时内容无法居中——gzb20171018 -->
    </div>
    <div class="easyui-panel" id="jysfDiv" style="border-top: none;">
        <div id="jfDiv" style="padding-left:2em;">
            <b>甲  方</b>：广州市
            <input class="jqxy_form_control iptBotBor" style="width:171px" name="JGXZQHMC" id="JGXZQHMC" readonly="readonly"/>
            <input class="jqxy_form_control iptBotBor" style="width:302px;margin-left:-4px" name="YFYLJGMC" id="YFYLJGMC" readonly="readonly"/>
            <p style="text-indent:3.2em;margin-top:10px;">
                <span>责任团队联系人：</span>
                <input class="jqxy_form_control iptBotBor" style="width:80px" name="YFXM" readonly="readonly"/>
                <span style="margin-left:10px">联系方式：</span>
                <input class="jqxy_form_control iptBotBor" style="width:258px" name="YFSJHM" readonly="readonly"/>
            </p>
        </div>
        <div style="margin-top:8px;padding-left:2em;"  id="yfDiv">
            <b>乙  方</b>：
            <input class="jqxy_form_control iptBotBor" style="width:80px" name="XM" readonly="readonly"/>
            <span style="margin-left:10px">固定电话：</span>
            <input class="jqxy_form_control iptBotBor" style="width:135px;" name="GDDH" quick-config="label:'固定电话', validateProxy:'notNull'"/>
            <span style="margin-left:10px;">手机：</span>
            <input class="jqxy_form_control iptBotBor" name="SJHM" style="width:164px;" readonly="readonly">
            <p style="text-indent:3.2em;margin-top:7px;">
                <span>家庭住址：</span>
                <input class="jqxy_form_control iptBotBor" style="width:450px;text-align: left" name="JTZZ" readonly="readonly"/>
            </p>
            <p style="text-indent:3.2em;margin-top:7px;">
                <span>是否参保：</span>
                <select class="jqxy_form_control" name="SFCB" style="width: 45px;height: 22px;" id="SFCB">
                    <option>是</option>
                    <option>否</option>
                </select>
                <input id="sfcbInput" class="jqxy_form_control iptBotBor" style="width:50px;display:none" name="SFCB" />
            </p>
        </div>
    </div>
    <div class="easyui-panel" style="border-top: none;border-bottom:0">
        <div class="xynr">
            <p style="line-height:25px;margin-top:-8px;">
                乙方自愿选择
                <span class="jqxy_form_control" name="FWBMC" id="FWBMC" style="color: blue;font-size: 12px;font-weight: bold;"></span>
                服务包，该服务包优惠后金额为
                <input class="jqxy_form_control iptBotBor" name="FY" readonly="readonly"/>元，
                其中基本公卫经费支付
                <input class="jqxy_form_control iptBotBor" name="GWJFZF" readonly="readonly"/>元，
                医保支付
                <input class="jqxy_form_control iptBotBor" name="YBGRZF" readonly="readonly"/>元，
                个人支付
                <input class="jqxy_form_control iptBotBor" name="JMZFFY" readonly="readonly"/>元。
            </p>
            <p>
                有效期为:
                <span class="jqxy_form_control" name="sxsj" id="sxsj">年月日</span>
                <span>至</span>
                <span class="jqxy_form_control" name="jssj" id="jssj">年月日</span>
            </p>
        </div>
    </div>
    <div class="easyui-panel" ><!--title="协议服务内容"-->
        <div class="xynr" id="xynrDiv" style="margin-top:-10px">
        </div>
    </div>



    <!--     操作相关信息——开始    -->
    <div class="easyui-panel czxxDiv" title="转介信息" id="zjxxDiv" closed="true">
        <table class="form-table" style="table-layout: fixed">
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>转介申请时间：</label></td>
                <td style="border:0px;background:#fff"><span name="SQRQ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>原签约团队：</label></td></td>
                <td style="border:0px;background:#fff"><span name="YQYTDMC" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>原签约医生：</label></td></td>
                <td style="border:0px;background:#fff"><span name="SQYS" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>审核通过时间：</label></td>
                <td style="border:0px;background:#fff"><span name="ZJSHTGSJ" class="jqxy_form_control"></span></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>新签约团队：</label></td></td>
                <td style="border:0px;background:#fff"><span name="XQYTDMC" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>签约医生：</label></td></td>
                <td style="border:0px;background:#fff"><span name="YFXM" class="jqxy_form_control"></span></td>
            </tr>
        </table>
    </div>


    <div class="easyui-panel czxxDiv" title="变更信息" id="bgxxDiv" closed="true">
        <table class="form-table">
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>变更时间：</label></td>
                <td style="border:0px;background:#fff;min-width: 85px;"><span name="BGSJ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>原签约服务包：</label></td></td>
                <td style="border:0px;background:#fff"><span name="YQYFWB" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>操作人员：</label></td>
                <td style="border:0px;background:#fff"><span name="YFXM" class="jqxy_form_control"></span></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>新签约服务包：</label></td></td>
                <td style="border:0px;background:#fff"><span name="FWBMC" class="jqxy_form_control"></span></td>
            </tr>
        </table>
    </div>


    <div class="easyui-panel czxxDiv" title="解约信息" id="jyxxDiv" closed="true">
        <table class="form-table" style="table-layout: fixed">
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>解约时间：</label></td>
                <td style="border:0px;background:#fff"><span name="JYSJ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>操作人员：</label></td></td>
                <td style="border:0px;background:#fff"><span name="YFXM" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>原签约有效期：</label></td>
                <td style="border:0px;background:#fff"><span name="SXSJ" class="jqxy_form_control"></span> 至 <span name="JSSJ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>原签约团队：</label></td></td>
                <td style="border:0px;background:#fff"><span name="QYTDMC" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right;vertical-align:middle" class="td-text"><label>原签约服务包：</label></td></td>
                <td style="border:0px;background:#fff" colspan="3"><span name="FWBMC" class="jqxy_form_control"></span></td>
            </tr>
        </table>
    </div>

    <div class="easyui-panel czxxDiv" title="续约信息" id="xyxxDiv" closed="true">
        <table class="form-table" style="table-layout: fixed" cellspacing="0" >
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>续约时间：</label></td>
                <td style="border:0px;background:#fff"><span name="XYSJ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>签约医生：</label></td></td>
                <td style="border:0px;background:#fff"><span name="YFXM" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>续约有效期：</label></td>
                <td style="border:0px;background:#fff"><span name="SXSJ" class="jqxy_form_control"></span> 至 <span name="JSSJ" class="jqxy_form_control"></span></td>
                <td style="border:0px;background:#fff;text-align:right" class="td-text"><label>续约团队：</label></td></td>
                <td style="border:0px;background:#fff"><span name="QYTDMC" class="jqxy_form_control"></span></td>
            </tr>
            <tr>
                <td style="border:0px;background:#fff;text-align:right;" class="td-text"><label>续约服务包：</label></td>
                <td style="border:0px;background:#fff" colspan="3" align=""><span name="FWBMC" class="jqxy_form_control"></span></td>
            </tr>
        </table>
    </div>

    <!--     操作相关信息——结束    -->





    <div class="easyui-panel">
        <table style="table-layout:fixed;font-weight:bold;border:0;width:95%;margin: 3px auto;" cellspacing="-1">
            <tr style="height:30px;line-height:30px;">
                <td style="width:17%;text-align: right;">甲方盖章：</td>
                <td style="width:20%"></td>
                <td style="width:26%;text-align: right;">乙方签字：</td>
                <td>
                    <img width="100%" height="38px" style="border:0;display:none" id="xymb_qmtp">
                </td>
            </tr>
            <tr style="height:30px;line-height:30px;">
                <!-- 转义：&#160;==&nbsp;-->
                <td style="text-align: right;">年&#160;<span style="margin:0 8px">月</span>&#160;日</td>
                <td></td>
                <td style="text-align: right;">年&#160;<span style="margin:0 8px">月</span>&#160;日</td>
                <td></td>
            </tr>
            <tr style="height:20px;line-height:20px;"><td></td></tr>
            <tr style="height:30px;line-height:30px;">
                <td style="text-align: right;">解约时间：</td>
                <td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000;" colspan="3"></td>
            </tr>
            <tr style="height:30px;line-height:30px;">
                <td style="text-align:right">解约原因：</td>
                <td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000;" colspan="3"></td>
            </tr>
            <tr style="height: 10px;"><td></td></tr>
            <tr style="height:30px;line-height:30px;">
                <td style="text-align:right">甲方盖章：</td>
                <td></td>
                <td style="text-align:right">乙方签字：</td>
                <td></td>
            </tr>
            <tr style="height:20px;line-height:20px;"><td></td></tr>
            <tr style="height:30px;line-height:30px;">
                <td style="text-align:right">监督投诉电话：</td>
                <td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000;" colspan="3"></td>
            </tr>
        </table>

        <style>
            .panel,.panel-header,.panel-body{
                background:#fff;
                border:0
            }
            .panel-title{
                font-size: 15px;
            }
            .form-table td {
                padding: 3px;
            }
            .czxxDiv .td-text{
                width: 100px!important;
                box-sizing: border-box;
                vertical-align: middle;
            }
            .czxxDiv td{
                vertical-align: middle;
                line-height: 20px;
            }
            .edui-container p,#xynrDiv p{
                line-height: 25px;
            }
            .xynr{
                padding: 10px 8px;
            }
            .xynr p{
                text-indent:2em;
                margin-top: 7px;
            }
            .iptBotBor{
                border: none;
                border-bottom: 1px solid #B6B6B6;
                border-radius: 0px;
                height: 17px;
                width: 70px;
                line-height: 24px;
                text-align: center;
                position:relative;
            }
        </style>
        <script>
        //模板类
        var XymbMethod = {};

        /** 载入协议模板数据 */
        XymbMethod.initXymbData = function(result){
            if(!$.isEmptyObject(result)){
                //格式化数据
                formatNeedInsertXyData_gzb(result);
                //载入数据
                $(".jqxy_form_control").each(function () {
                    var value = result[$(this).attr("name")];
                    if(!StringUtils.isEmpty(value)){
                        if(this.tagName=="INPUT"){
                            $(this).val(value).attr("value",value);
                        }else{
                            $(this).html(value)
                        }
                    }
                })
                //机构Input宽度重置
                $("#YFYLJGMC,#JGXZQHMC").each(function(){
                    var sensor = $('<pre></pre>').html(this.value).css({display: 'none'});
                    $('body').append(sensor);
                    var width = sensor.width();
                    sensor.remove();
                    var thisWidth = $(this).width();
                    var flag = width - thisWidth;
                    if(Math.abs(flag)==flag){ //不能用大于比较，大于号回被转义为：&gt;
                        $(this).width(width);
                    }
                })
                //数据保存
                var resultCopy = $.extend({},result);
                delete resultCopy.XYMB;
                $("#jfDiv").attr("data",JSON.stringify(resultCopy).replace(/"/g, "'"));
                if(StringUtils.isEmpty(result.FWBIDS)){
                    throw new Error("数据中不存在FWBIDS,请给定所选服务包对应的ID,服务包的分隔符为'|'");
                }
            }
        }

        /** 格式化需要载入协议的数据_author */
        function formatNeedInsertXyData_gzb(result){
            //1."健康城市"数据
            if(!StringUtils.isEmpty(result.YLJGMC)) result.YFYLJGMC = result.YLJGMC;
            if(!StringUtils.isEmpty(result.LXDH)) result.GDDH = result.LXDH;
            if(!StringUtils.isEmpty(result.XZQHMC)) result.JGXZQHMC = result.XZQHMC;
            if(!StringUtils.isEmpty(result.ZFY)) result.FY = result.ZFY;
            if(!StringUtils.isEmpty(result.ZGWJFZF)) result.GWJFZF = result.ZGWJFZF;
            if(!StringUtils.isEmpty(result.ZYBGRZF)) result.YBGRZF = result.ZYBGRZF;
            if(!StringUtils.isEmpty(result.ZJMZFFY)) result.JMZFFY = result.ZJMZFFY;
            if(!StringUtils.isEmpty(result.ZJMZFFY)) result.JMZFFY = result.ZJMZFFY;
            if(!StringUtils.isEmpty(result.QYYS)) {
                if(StringUtils.isEmpty(result.YFXM)){//不能用“并”
                    result.YFXM = result.QYYS;
                }
            }
            if(!StringUtils.isEmpty(result.YSSJHM)) result.YFSJHM = result.YSSJHM;

            var timeReg = /^(\d{4})-(\d{2})-(\d{2})/;
            if(!StringUtils.isEmpty(result.SXSJ)) result.sxsj = result.SXSJ.replace(timeReg,"$1年$2月$3日");
            if(!StringUtils.isEmpty(result.JSSJ)) result.jssj = result.JSSJ.replace(timeReg,"$1年$2月$3日");

            //2."签约平台"数据——无
        }

        /** 保存模板前需要执行的方法 */
        XymbMethod.saveXymbAgo = function(){
            $("input.jqxy_form_control").each(function(){
                $(this).attr("value",this.value);
            })
            $("#SFCB option:selected").attr("selected","selected");
        }
    </script>
    </div>

</div>

</div>